<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>驾校信息管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
	content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
<meta name="author" content="Muhammad Usman">

<!-- The styles -->
<link
	href="<%=request.getContextPath()%>/resources/css/bootstrap-cerulean.min.css"
	rel="stylesheet">
<link
	href="<%=request.getContextPath()%>/resources/css/charisma-app.css"
	rel="stylesheet">
<link
	href='<%=request.getContextPath()%>/resources/bower_components/fullcalendar/dist/fullcalendar.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/fullcalendar/dist/fullcalendar.print.css'
	rel='stylesheet' media='print'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/chosen/chosen.min.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/colorbox/example3/colorbox.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/responsive-tables/responsive-tables.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css'
	rel='stylesheet'>
<link href='<%=request.getContextPath()%>/resources/css/jquery.noty.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/css/noty_theme_default.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/css/elfinder.min.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/css/elfinder.theme.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/css/jquery.iphone.toggle.css'
	rel='stylesheet'>
<link href='<%=request.getContextPath()%>/resources/css/uploadify.css'
	rel='stylesheet'>
<link href='<%=request.getContextPath()%>/resources/css/animate.min.css'
	rel='stylesheet'>
<link href='<%=request.getContextPath()%>/resources/MyCss/main.css'
	rel='stylesheet'>

<!-- jQuery -->
<script
	src="<%=request.getContextPath()%>/resources/bower_components/jquery/jquery.min.js"></script>

<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<!-- The fav icon -->
<link rel="shortcut icon"
	href="<%=request.getContextPath()%>/resources/img/favicon.ico">
</head>

<body>
	<div class="modal fade" id="addSchoolModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<form action="<%=request.getContextPath()%>/school/addSchool"
					method="post">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title" id="myModalLabel">添加驾校</h4>
					</div>
					<div class="modal-body">
						<p>
							<label>驾校名称*</label> <input type="text" name="name"
								class="form-control" />
						</p>
						<p>
							<label>驾校地址*</label> <input type="text" name="address"
								class="form-control" />
						</p>
						<p>
							<label>企业代码*</label> <input type="text" name="code"
								class="form-control" />
						</p>
						<p>
							<label>可培育车型*</label> <input id="carType-add" type="hidden"
								name="carTypes" class="form-control" />
						</p>
						<div class="checkbox-pos">
							<c:forEach items="${carTypes }" var="ct">
								<div class="checkbox checkbox-width">
									<input type="checkbox" id="${ct.id }edit-add"
										onchange="javascript:changeT('#${ct.id }edit-add','#carType-add')"
										value="${ct.name }"> ${ct.name }
								</div>
							</c:forEach>
						</div>
						<span id="ajax-error-message"></span>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
						<button type="submit" class="btn btn-primary">添加驾校</button>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal fade" id="editSchoolModal" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<form action="<%=request.getContextPath()%>/school/updateSchool"
					method="post">
					<input type="hidden" name="id" />
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title" id="myModalLabel">编辑驾校信息</h4>
					</div>
					<div class="modal-body">
						<p>
							<label>驾校名称*</label> <input type="text" name="name"
								class="form-control" />
						</p>
						<p>
							<label>驾校地址*</label> <input type="text" name="address"
								class="form-control" />
						</p>
						<p>
							<label>企业代码*</label> <input type="text" name="code"
								class="form-control" />
						</p>
						<p>
							<label>可培育车型*</label> <input id="carType-edit" type="hidden"
								name="carTypes" class="form-control" />
						</p>
						<div class="checkbox-pos" id="check-edit">
						<c:forEach items="${carTypes }" var="ct">
								<div class="checkbox checkbox-width">
									<input type="checkbox" id="${ct.id }edit-edit"
										onchange="javascript:changeT('#${ct.id }edit-edit','#carType-edit')"
										value="${ct.name }"> ${ct.name }
								</div>
							</c:forEach>
						</div>
						<span id="ajax-error-message"></span>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
						<button type="submit" class="btn btn-primary">编辑信息</button>
					</div>
				</form>
			</div>
		</div>
	</div>
	<jsp:include page="../toolbar.jsp"></jsp:include>
	<div class="ch-container">
		<div class="row">
			<jsp:include page="../snav.jsp"></jsp:include>
			<div id="content" class="col-lg-10 col-sm-10">
				<div class="container-fluid">
					<div class="row-fluid">
						<div class="span12">
							<span><a href="javascript:modalShow('#addSchoolModal');">添加驾校</a></span>
							<table class="table" id="schoolTable">
								<thead>
									<tr>
										<th>驾校名称</th>
										<th>企业地址</th>
										<th>驾校代码</th>
										<th>可培育车型</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${schools }" var="s">
										<tr>
											<td id="name${s.id }">${s.name }</td>
											<td id="address${s.id }">${s.address }</td>
											<td id="code${s.id }">${s.code }</td>
											<td id="carTypes${s.id }">${s.carTypes }</td>
											<td><a
												href="javascript:schoolEdit('#editSchoolModal','${s.id }');">信息编辑</a>
												| <a
												href="<%=request.getContextPath()%>/school/deleteSchool/${s.id}">删除</a></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<jsp:include page="../foot.jsp"></jsp:include>




</body>
</html>

